//
//  StatusNormalCell.swift
//  新浪微博01
//
//  Created by 李国伟 on 15/12/14.
//  Copyright © 2015年 李国伟. All rights reserved.
//

import UIKit

class StatusNormalCell: StatusCell {

    //重写模型的didset方法
    override var  viewModel: StatusViewModel?{
        didSet{
            
            //根据配图的数量设置间距
            let offset = viewModel?.thumbnailUrls?.count > 0 ? StatusCellMargin : 0
            pictureView.snp_updateConstraints { (make) -> Void in
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
            }
        }
    }

    //重写set方法重新设置pictureView的控件约束
    override func setupUI() {
        super.setupUI()
        
        //设置pictureView的约束
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(StatusCellMargin)
            make.left.equalTo(contentLabel)
        }
    }
}